// AutoReportGenerator.h: interface for the AutoReportGenerator class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_AUTOREPORTGENERATOR_H__FE65A259_DE51_403A_B9B8_D80FA43C0B62__INCLUDED_)
#define AFX_AUTOREPORTGENERATOR_H__FE65A259_DE51_403A_B9B8_D80FA43C0B62__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ReportQueryHandler.h"

#include "MonitoringUnitLib\MonitoringUnitType.h"

class BaseCoalMineUnit;

class AutoReportGenerator : public ReportQueryHandler
{
public:
	AutoReportGenerator();
	virtual ~AutoReportGenerator();

	virtual bool Prehandling() {return true;}

protected:
	virtual ReportTempletAckStruct * GetReportTemplet();
	virtual void ReportGenerated(ReportAckStruct * pReportAckStruct);

	void CollectMonUnitsFromDefinitionFile(std::vector<MonUnitItem *>& vecMonUnitItems);
	void CollectMonUnitsFromDefinitionFileEx(std::vector<MonUnitItem *>& vecMonUnitItems);

	ReportTempletAckStruct * AutoGenerateReportTemplet(const std::vector<MonUnitItem *>& vecMonUnitItems);

	void ExportReportView(ReportAckStruct * pReportAckStruct);
	ReportAckStruct * ViewExcessReport(ReportTempletHeader * pReportTempletHeader, const std::vector<ReportField *>& vecReportFields, const std::vector<CString>& vecReportItemStrings, BaseCoalMineUnit * pCoalMineUnit = NULL);
	ReportAckStruct * ViewDigitalReport(ReportTempletHeader * pReportTempletHeader, const std::vector<ReportField *>& vecReportFields, const std::vector<CString>& vecReportItemStrings, MonitoringUnitType::Types nType, BaseCoalMineUnit * pCoalMineUnit = NULL);
	ReportAckStruct * ViewAnalogReport(ReportTempletHeader * pReportTempletHeader, const std::vector<ReportField *>& vecReportFields, const std::vector<CString>& vecReportItemStrings, BaseCoalMineUnit * pCoalMineUnit = NULL);
	void GetNameOfStatesByType(CString& strStateName0, CString& strStateName1, CString& strStateName2, MonitoringUnitType::Types nType, BaseCoalMineUnit * pCoalMineUnit = NULL);
	void GetNameOfStatesByTypeEx(CString& strStateName0, CString& strStateName1, CString& strStateName2, MonitoringUnitType::Types nType, BaseCoalMineUnit * pCoalMineUnit = NULL);
};

#endif // !defined(AFX_AUTOREPORTGENERATOR_H__FE65A259_DE51_403A_B9B8_D80FA43C0B62__INCLUDED_)
